package com.lagou.module01.service.imp;

import com.lagou.module01.bean.PageBean;
import com.lagou.module01.bean.Student;
import com.lagou.module01.dao.StudentDao;
import com.lagou.module01.dao.UserDao;
import com.lagou.module01.factory.DaoFactory;
import com.lagou.module01.service.StudentService;

import java.util.List;

/**
 * @Author: xyk
 * @Date: Create in 23:14 2021/3/14
 * @Description:
 */
public class StudentServiceImp implements StudentService {

    // 自定义成员变量用户数据访问对象
    private StudentDao studentDao;

    public StudentServiceImp() {
       this.studentDao = DaoFactory.getStudentDao();
    }

    @Override
    public List<Student> showStudentsService(PageBean pageBean) {
        return studentDao.studentsShow(pageBean);
    }

    @Override
    public int countStudentsService() {
        return studentDao.getStudentCount();
    }

    @Override
    public boolean insertStudentsService(Student student) {
        return studentDao.insertStudent(student);
    }

    @Override
    public boolean editStudentsService(Student student) {
        return studentDao.editStudent(student);
    }

    @Override
    public Student queryStudentsService(String id) {
        return studentDao.queryStudent(id);
    }

    @Override
    public boolean deleteStudentsService(String id) {
        return studentDao.deleteStudent(id);
    }

}
